package com.rentplant.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.rentplant.Pojo.user;
import com.rentplant.mapper.userMapper;
import com.rentplant.service.userService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service //让他知道这是service
public class userServiceImp implements userService {

//自动找寻类
    @Autowired
    private userMapper usermapper;

// 重写方法
//  搜索用户信息
    @Override
    public List<user> userInfo(String openid){
        return usermapper.userInfo(openid);
    }

//    修改个人信息
    @Override
    public boolean updateInfo(JSONObject personinfo){
        return usermapper.updateInfo(personinfo);
    }

//    添加用户信息
    @Override
    public  boolean addUser(JSONObject personinfo){
            return usermapper.addUser(personinfo);
    }

//    更新余额
    @Override
    public boolean updateMoney(JSONObject personinfo){return usermapper.updateMoney(personinfo);}

//    更新微信用户信息
    @Override
    public boolean updateWxInfo(JSONObject personinfo){return usermapper.updateWxInfo(personinfo);}



//    管理端接口
    //   查询全部用户分页
    @Override
    public List<user> allUser(JSONObject pageInfo){return usermapper.allUser(pageInfo);}

    //    查询全部用户
    @Override
    public List<user> allUsers(){return usermapper.allUsers();}

    //    更改用户信息
    @Override
    public boolean updateUserInfo(JSONObject userInfo){return usermapper.updateUserInfo(userInfo);}

    //    按条件查询
    @Override
    public List<user> partUser(JSONObject searchInfo){return usermapper.partUser(searchInfo);}
    //    按条件查询
    @Override
    public List<user> partUsers(JSONObject searchInfo){return usermapper.partUsers(searchInfo);}

}
